package com.googlecode.tidej.client;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.SuggestOracle;
import com.googlecode.tidej.client.project.ProjectMetaData;
import com.googlecode.tidej.client.project.ProjectManager;
import com.googlecode.tidej.client.util.DataSource;
import com.googlecode.tidej.shared.model.Artifact;
import com.googlecode.tidej.shared.model.Library;
import com.googlecode.tidej.shared.model.Model;
import com.googlecode.tidej.shared.model.Operation;
import com.googlecode.tidej.shared.model.Property;
import com.googlecode.tidej.shared.model.Type;

public interface TidejController {

  public void select(Artifact artifact);

  public void selected(Artifact artifact);

  public Model getModel();

  public void saveCode(Type type);
  
  public void saveCode();
  
  public void upload();

  // TODO(haustein) Don't expose project manager(?)
  public ProjectManager getProjectManager();
  
  public Library getProject();

  public void closeProject(boolean save);

  public void deleteProject();

  public void refreshSubtree(Artifact parent);

  public void deleteType(Type type);

  void createProject(ProjectMetaData metaData, DataSource fromSample);

  void openProject(String name, AsyncCallback<Void> callback);

  public void deleteOperation(Operation operation);

  public void deleteProperty(Property property);
  
  public SuggestOracle getTypeSuggestOracle();

  public void connect();
  
  public void setOnlineState(String url, boolean connected);
}
